package top.gjn998.condition.condition;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
 
import java.util.Objects;
 
/**
 * @Author guozepeng
 * @Description 召唤神龙的条件
 * @Date 2021/11/19
 */
public class DragonCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {

        return 7 == Integer.parseInt(Objects.requireNonNull(context.getEnvironment().getProperty("summon.dragon-ball")));
    }
}